<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <link rel="stylesheet" type="text/css" href="/jquery-easyui-1.3.3/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="/jquery-easyui-1.3.3/themes/icon.css"/>
    <script type="text/javascript" src="/jquery-easyui-1.3.3/jquery.min.js"></script>
    <script type="text/javascript" src="/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<table id="dg" class="easyui-datagrid" title="用户管理" url="/admin/user/list" toolbar="#tb"
       fit="true" fitColumns="true" pagination="true" rownumbers="true" singleSelect="true">
    <thead>
    <th field="id" width="20px" align="center">编号</th>
    <th field="userName" width="50px" align="center">用户名</th>
    <th field="password" width="50px" align="center">密码</th>
    <th field="trueName" width="50px" align="center">真实姓名</th>
    <th field="remarks" width="80px" align="center">备注</th>
    <th field="roles" width="150px" align="center">角色</th>
    <th field="rolesEdit" width="50px" align="center" formatter="formatRolesEdit">角色设置</th>
    </thead>
</table>
<div id="tb">
    <div>
        <a href="javascript:openUserAddDialog()" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
        <a href="javascript:openUserModifyDialog()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
        <a href="javascript:deleteUser()" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
    </div>
    <div>
        &nbsp;用户名：&nbsp;<input type="text" id="s_userName" size="20" onkeydown="if(event.keyCode==13) searchUser()"/>
        <a href="javascript:searchUser()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
    </div>
</div>
</body>
</html>

<script>
    function formatRolesEdit(val, row) {
        return "<a href=''><img style='margin-top:4px' src='/images/edit.gif'/></a>";
    }

    function searchUser() {
        $("#dg").datagrid('load', {
            "userName": $("#s_userName").val()
        });
    }
    $.parser.parse('#s_userName');
</script>